﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using System.Diagnostics;

namespace WasaWasa
{
    class VersionInfoClass
    {
        public string Title { get; private set; }
        public string Version { get; private set; }
        public string Product { get; private set; }
        public string Company { get; private set; }
        public string Copyright { get; private set; }
        public string Description { get; private set; }

        public VersionInfoClass()
        {
            Assembly asm = Assembly.GetExecutingAssembly();
            FileVersionInfo ver = FileVersionInfo.GetVersionInfo(asm.Location);
            Version = ver.FileVersion;
            Title = (Attribute.GetCustomAttribute(asm, typeof(AssemblyTitleAttribute)) as AssemblyTitleAttribute).Title;
            Product = (Attribute.GetCustomAttribute(asm, typeof(AssemblyProductAttribute)) as AssemblyProductAttribute).Product;
            Company = (Attribute.GetCustomAttribute(asm, typeof(AssemblyCompanyAttribute)) as AssemblyCompanyAttribute).Company;
            Copyright = (Attribute.GetCustomAttribute(asm, typeof(AssemblyCopyrightAttribute)) as AssemblyCopyrightAttribute).Copyright;
            Description = (Attribute.GetCustomAttribute(asm, typeof(AssemblyDescriptionAttribute)) as AssemblyDescriptionAttribute).Description;
        }
    }
}
